/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-06
 * Time: 13:47
 */

/**
 * 静态内部类
 * 静态内部类中不能访问外部类的非静态成员,如果非要访问，new外部类对象
 * 获取静态内部类对象：Out2.Inner2 inner2 = new Out2.Inner2();
 */
class Out2 {
    public int data1 = 1;
    int data2 = 2;
    public static int data3 = 3;
    static class Inner2 {
        public int data4 = 4;
        int data5 = 5;
        public static int data6 = 6;
        public void func() {
            Out2 out2 = new Out2();
            System.out.println(out2.data1);
            System.out.println(out2.data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(data6);
        }
    }
}
public class Test2 {
    public static void main(String[] args) {
        Out2.Inner2 inner2 = new Out2.Inner2();
        inner2.func();
    }
}
